<template>
	<view id="detailist" class="p03">
		<!-- 余额流水 start -->
		<block v-if="listType === 'balance'">
			<view class="f-s-ac top-line" v-for="item in data" :key="item.outTradeNo" >
				<view class="o-h f-g-1 mr30 f32" @click="goDl(item)">
					<!-- 提现方式 -->
					<view class="t-o-e f-x-bt">
						<view class="f28 " :class="{typeUp:item.item == '1',typeDown:item.item != '1'}">{{item.note}}</view>
						<view class="wei">
							<view class="f-g-0 f32" :style="{color:item.item == '1'?'#67c23a':'#f56c6c'}">{{getSymbol(item.item).text}}{{item.money}}</view>
						</view>
					</view>
					<view class="c9 f24 f-x-bt mt20">
						<view class="f-col">
							<view class="c9 f24">{{item.createdAt}}</view>
						</view>
						<view class="f-col">
							<view>余额: <text class="c0">{{item.currentMoney}}</text></view>
						</view>
					</view>
				</view>
			</view>
		</block>
		<!-- 余额流水 end -->
		<!-- 订单查询 start -->
		<block v-if="listType === 'orderQuery'">
			<view class="f-s-ac top-line" v-for="item in data" :key="item.outTradeNo" >
				<view class="o-h f-g-1 mr30 f32" @click="goDl(item)">
					<view class="t-o-e f-x-bt">
						<!-- 外卖 -->
						<view v-if="item.origin == 1" class="f28 typeUp">{{item.originName}}</view>
						<!-- 当面付 -->
						<view v-else-if="item.origin == 5" class="f28 typeFace">{{item.originName}}</view>
						<!-- 堂食 -->
						<view v-else-if="item.origin == 7" class="f28 typeIn">{{item.originName}}</view>
						<!-- 快餐 -->
						<view v-else-if="item.origin == 6" class="f28 typeOut">{{item.originName}}</view>
						<!-- 其他 -->
						<view v-else-if="item.origin == 4" class="f28 typeOther">{{item.originName}}</view>
						<view class="wei">
							<view class="f-g-0 f32" :style="{color:'#67c23a'}">{{item.storeActualMoney}}</view>
						</view>
					</view>
					<view class="c9 f24 f-x-bt mt20">
						<view class="f-col">
							<view class="c9 f24">{{item.createdAt}}</view>
						</view>
						<view class="f-col">
							<view>订单状态: <text class="c0" :style="{color:item.state ==1?'#67c23a':'#409eff'}">{{item.stateNote}}</text></view>
						</view>
					</view>
				</view>
			</view>
		</block>
		<!-- 订单查询 end -->
	</view>
</template>

<script>
	export default{
		props:{
			data:'',
			symbol:{
			  type: String,
			  default: '-'
			},
			listType:{
			  type: String,
			  default: ''
			}
		},
		data() {
			return {}
		},
		methods:{
			getSymbol(item){
				var text = ''
				switch(item){
					case '1':
						text = '+'
						break;
					case '2':
						text = '-'
						break;
					default:
						break;
				}
				return {text}
			},
			goDl(item){
				uni.setStorageSync('flowListDetails',item)
				this.go({
					t:1,
					url:'/yb_shd/dp/statement/order-detail?type=' + this.listType
					})
			},
		}
	}
</script>

<style scoped lang="scss">
	.top-line{
		border-top: 1px solid #eee;
		padding: 20rpx 0;
	}
	.typeUp{
		background-color: #f0f9eb;
		border-color: #e1f3d8;
		color: #67c23a;
		padding: 0 10rpx;
	}
	.typeDown{
		background-color: #fef0f0;
		border-color: #fde2e2;
		color: #f56c6c;
		padding: 0 10rpx;
	}
	.typeFace{
		background-color: #ecf5ff;
		border-color: #d9ecff;
		color: #409eff;
		padding: 0 10rpx;
	}
	.typeIn{
		background-color: #fdf6ec;
		border-color: #faecd8;
		color: #e6a23c;
		padding: 0 10rpx;
	}
	.typeOut{
		background-color: #fef0f0;
		border-color: #fde2e2;
		color: #f56c6c;
		padding: 0 10rpx;
	}
	.typeOther{
		background-color: #f4f4f5;
		border-color: #e9e9eb;
		color: #909399;
		padding: 0 10rpx;
	}
</style>
